﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.Modeling.Design;
using System.ComponentModel;

namespace devtm.AutoMapper
{
    public partial class Mapper
    {

        public static void UpdateProperties(MappingSource source, bool refresh)
        {
            MappingHelper.GenerateMapping(source, refresh);            
        }


        public override MappingSource MappingSource
        {
            get
            {
                return base.MappingSource;
            }
            set
            {
                base.MappingSource = value;
            }
        }

        public override MappingDestination MappingDestination
        {
            get
            {
                return base.MappingDestination;
            }
            set
            {
                base.MappingDestination = value;
            }
        }


        public void Refresh()
        {

            Mapper.UpdateProperties(MappingSource, true);

        }

    }
}
